Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Make success hook public #210

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Make success hook public #210

merged 1 commit into from
Nov 12, 2019

Conversation

narape
Copy link
Contributor

@narape narape commented Nov 12, 2019

Hey, I just made a Pull Request!

Description

Make BigQueryOperation.success public

Motivation and Context

As described in #125 , the original
idea was to be able to write

final Task<TableId> task = Task.named("task")
    .ofType(TableId.class)
    .context(BigQueryContext.create(table))
    .context(BigQueryOperator.create())
    .process((stagingTable, bq) -> bq.job(
        JobInfo.of(QueryJobConfiguration.newBuilder("SELECT foo FROM input")
            .setDestinationTable(stagingTable.tableId())
            .build()))
        .success(response -> stagingTable.publish()));

But because success is package private this use case is only allowed in
the classes in the same package, like in the unit test

Have you tested this? If so, how?

Same test suit. Manually I also created a dummy class with main and copied the code above

Checklist for PR author(s)

  • Changes are covered by unit test
  • [x ] All tests pass
  • Code coverage check passes
  • Error handling is tested
  • Errors are handled at the appropriate layer
  • Errors that cannot be handled where they occur are propagated
  • Relevant documentation updated
  • This PR has NO breaking change to public API
  • This PR has breaking change to public API and it is documented

Checklist for PR reviewer(s)

  • This PR has been incorporated in release note for the coming version
  • Risky changes introduced by this PR have been all considered

As described in #125 , the original
idea was to be able to write
final Task<TableId> task = Task.named("task")
    .ofType(TableId.class)
    .context(BigQueryContext.create(table))
    .context(BigQueryOperator.create())
    .process((stagingTable, bq) -> bq.job(
        JobInfo.of(QueryJobConfiguration.newBuilder("SELECT foo FROM input")
            .setDestinationTable(stagingTable.tableId())
            .build()))
        .success(response -> stagingTable.publish()));

But because success is package private this use case is only allowed in
the classes in the same package, like the unit test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants